<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>未归零问题预警</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .qbdms-label{
            width: 80px;
        }
        .qbdms-input{
        margin-left:80px;
        }
    </style>
</head>
<body>
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body" style="padding:24px;padding-left: 48px">
        <form class="layui-form"  requrl="${ctx}/qbdms/unZero/get"lay-filter="wQbdUnzeroWarningDataForm">
            <div class="layui-row">
                <div style="width: 84%">
                    <label class="layui-form-label qbdms-label" title="一般">超过<span style="color: red;">*</span></label>
                    <div class="layui-input-block qbdms-input">
                        <input style="float: left;width: 68%;margin-right: 16px" type="text" name="general" lay-verify="required|integer"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="general">
                        <p style="line-height: 34px;">天<span style="display: inline-block;width: 50px;height: 26px;background: yellow;position: absolute;top: 13%;right: -16px;"></span></p>
                    </div>
                </div>
                <div style="width: 84%">
                    <label class="layui-form-label qbdms-label" title="严重">超过<span style="color: red;">*</span></label>
                    <div class="layui-input-block qbdms-input">
                        <input style="float: left;width: 68%;margin-right: 16px" type="text" name="serious"  lay-verify="required|integer|bigger"
                               autocomplete="off" class="layui-input " maxlength="50" fieldname="serious">
                        <p style="line-height: 34px;">天<span style="display: inline-block;width: 50px;height: 26px;background: red;position: absolute;top: 13%;right: -16px;"></span></p>

                    </div>
                </div>
            </div>
            <div class="layui-hide">
                <input type="text" name="id"  placeholder="请输入"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
                <input type="text" name="tenantId"  placeholder="请输入租户ID"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="tenantId">
            </div>
            <div class="layui-form-item btnformItem" style="padding: 0">
                <p style="text-align: center;">
                    <span id="hideAndShow" style="">
                            <a lay-submit lay-filter="wQbdUnzeroWarning" class="layui-btn btn-n privateSubmit qbdms-oneBtn"
                               requrl="${ctx}/qbdms/unZero/save">提交</a>
                    </span>
                    <button type="button" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine" style="margin-left: 10px;"
                            id="getDefault">恢复默认</button>
                    <button type="reset" id="closeWindow" style="margin-left: 10px;"
                            class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">取消
                    </button>
                </p>
            </div>
        </form>
    </div>
</div>


<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','common','laydate','jquery','qbdmsForm','publicMethods'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var form =layui.qbdmsForm;
        var publicMethods = layui.publicMethods;
        form.verify({
            integer: [
                /^[1-9]\d*$/
                , '只能输入正整数'
            ],
            bigger:function(value,item){
                if(parseInt(value)<= parseInt($("input[name='general']").val())){
                    return '严重情况天数应大于一般情况天数';
                }
                //$("input[name='serious']").val()>$("input[name='general']").val()
                    //,'严重情况天数应大于一般情况天数'
            }
        });

        //关闭当前页面
        $("#closeWindow").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });

        var runId = "${runId}";
        if(runId == null || runId == ''){
            $("#hideAndShow").show();
        }

        var common = layui.common;
        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name:'wQbdUnzeroWarningDataForm',
            idValue:"${tenantId}",
            primary:"id",
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    if($(".privateSubmit")){
                        $(".privateSubmit").attr("disabled",false).css("pointer-events","auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        parent.layer.close(index);
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                        parent.layui.table.reload('wQbdUnzeroWarningTable');
                        parent.layui.totalFilter.init('wQbdUnzeroWarningTable');
                        parent.window.Initialization();
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                    $(".privateSubmit").attr("disabled",false).css("pointer-events","auto");
                }
                return false;
            },dataCallback:function (data) {
                //数据的处理
            }
        });

        $(document).on('click','#getDefault',function(){
            //默认值
            var aDefault = ${aDefault};
            $("input[name='general']").val(aDefault.general);
            $("input[name='serious']").val(aDefault.serious);
        });
    });

</script>
</body>
</html>